import request from '@/utils/request'

export const fetchDeptAPI = (params) => {
  return request({
    url: '/depts',
    method: 'GET',
    params
  })
}

export const deleteDeptAPI = (id) => {
  return request({
    url: `/depts/${id}`,
    method: 'DELETE'
  })
}

export const addDeptAPI = (data) => {
  return request({
    url: '/depts',
    method: 'POST',
    data
  })
}

export const getDeptDetailAPI = (id) => {
  return request({
    url: `/depts/${id}`,
    method: 'GET'
  })
}

export const updateDeptAPI = (data) => {
  return request({
    url: `/depts`,
    method: 'PUT',
    data
  })
}
